<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
    <meta charset="utf-8"/>
    <title>米塔云平台管理系统</title>
    <link href="../plugins/bootstrap/bootstrap.min.css" rel="stylesheet"/>
    <link href="../plugins/bootstrapValidator/bootstrapValidator.min.css" rel="stylesheet"/>
    <link href="../plugins/font-awesome/css/all.min.css" rel="stylesheet"/>
    <link href="../customize/css/iconfont.css" rel="stylesheet">
    <link href="../customize/css/content.css" rel="stylesheet"/>
</head>
<body>
<div class="m-3">
    <div class="custom-section">
        <nav class="mb-3">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><i class="iconfont icon-xiaolan4"></i> 企业管理</li>
                <li class="breadcrumb-item active"><i class="iconfont icon-xiaolan5"></i> 企业信息管理</li>
            </ol>
        </nav>
        <div class="d-flex align-items-center justify-content-between">
            <div>
                <div shiro:hasAnyPermissions="enterprise:info, enterprise:info:opera" class="input-group mb-3">
                    <input type="text" class="form-control" placeholder="快捷查询" id="searchValue">
                    <div class="input-group-append">
                        <button class="btn btn-primary" type="button" onclick="getEnterpriseList()"><i
                                class="iconfont icon-dituyechaxun"></i></button>
                    </div>
                </div>
            </div>
            <div>
                <button shiro:hasPermission="enterprise:info:opera" class="btn btn-primary" type="button"
                        onclick="addInfo()"><i class="fa fa-plus"></i> 添加企业
                </button>
            </div>
        </div>
        <table class="table table-striped table-bordered table-center" id="enterpriseList">
        </table>
        <div id="page" class="page_div"></div>
    </div>
</div>
<!-- Modal -->
<div shiro:hasPermission="enterprise:info:opera" class="modal fade" id="addInfoModal" data-backdrop="static"
     tabindex="-1">
    <div class="modal-dialog modal-dialog-centered modal-lg">
        <form class="modal-content text-body" id="addInfoForm">
            <div class="modal-header">
                <div class="modal-title"><i class="iconfont icon-juxing"></i><span id="modal_title">添加企业</span></div>
                <button type="button" class="close" data-dismiss="modal">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="text-secondary font-p12 mb-2">注：带<span class="form-required">*</span><span
                        class="ml-3"></span>标识的为必填项
                </div>
                <div class="row">
                    <div class="col-6">
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label" for="validationCustom01">企业名称<span
                                    class="form-required">*</span></label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" name="name" id="validationCustom01">
                                <input type="hidden" name="id" id="id-id">
                                <input type="hidden" name="type" id="type" value="0">
                                <input type="hidden" name="methodType" value="0" id="type-id">
                            </div>
                        </div>
                        <div class="row">
                            <label class="col-sm-3 col-form-label" for="validationCustom02">位置<span
                                    class="form-required">*</span></label>
                            <div class="form-group col-sm-8 mb-2" id="area-select-box">
                                <select class="form-control"
                                        name="province" id="validationCustom02"
                                        onchange="getCityL(getSelectValue($('#validationCustom02')),$('#validationCustom03'))">
                                </select>
                            </div>
                            <div class="form-group offset-sm-3 col-sm-8 mb-2" id="city-id">
                                <select class="form-control" name="city" id="validationCustom03"

                                ></select>
                            </div>

                            <div class="form-group offset-sm-3 col-sm-8 mb-2" id="county-id">
                                <select class="form-control" name="county" id="validationCustom4"></select>
                            </div>
                            <div class="form-group offset-sm-3 col-sm-8 mb-2">
                        <textarea class="form-control" name="address" id="validationCustom04" rows="3"
                                  placeholder="输入详细地址"></textarea>
                            </div>
                            <div class="form-group offset-sm-3 col-sm-8">
                                <input class="form-control" type="text" name="position" id="validationCustom05"
                                       placeholder="输入经纬度，用于地图展示">
                                <a class="font-p14" href="https://lbs.amap.com/console/show/picker" target="_blank">在地图上选择坐标</a>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label">logo</label>
                            <div class="col-sm-8">
                                <a class="image-upload-area text-center d-flex align-items-center justify-content-center"
                                   href="##" onclick="$('#add_file_hide').click()">
                                    <img id="img_load_area" src="../customize/images/icon/image-upload.png" alt="">
                                </a>
                                <input type="file" name="logoFile" id="add_file_hide" style="display: none">
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label" for="validationCustom06">联系人<span
                                    class="form-required">*</span></label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" name="contact" id="validationCustom06">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label" for="validationCustom07">联系电话<span
                                    class="form-required">*</span></label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" name="phone" id="validationCustom07">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label" for="validationCustom08">企业文化</label>
                            <div class="col-sm-8">
                                <textarea class="form-control" name="culture" id="validationCustom08"
                                          rows="3"></textarea>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label" for="validationCustom09">企业介绍</label>
                            <div class="col-sm-8">
                                <textarea class="form-control" name="introduction" id="validationCustom09"
                                          rows="3"></textarea>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label">照片</label>
                            <div class="col-sm-8">
                                <a class="image-upload-area text-center d-flex align-items-center justify-content-center"
                                   href="##" onclick="$('#add_file_hide2').click()">
                                    <img id="img_load_area2" src="../customize/images/icon/image-upload.png" alt="">
                                </a>
                                <input type="file" name="photoFile" id="add_file_hide2" style="display: none">
                            </div>
                        </div>
                    </div>
                </div>


            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-primary">提交保存</button>
            </div>
        </form>
    </div>
</div>

<!-- 查看大图modal，有此功能的页面加 -->
<div class="modal fade" id="viewImageModal" tabindex="-1">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content text-body">
            <div class="modal-header">
                <div class="modal-title"><i class="iconfont icon-juxing"></i> 查看大图</div>
                <button type="button" class="close" data-dismiss="modal">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body font-p14">
                <img class="img-fluid" id="img_preview_area" src="" alt="">
            </div>
        </div>
    </div>
</div>
</body>
<script src="../plugins/jquery-3.4.1.min.js"></script>
<script src="../plugins/bootstrap/bootstrap.bundle.min.js"></script>
<script src="../plugins/bootstrapValidator/bootstrapValidator.min.js"></script>
<script src="../plugins/bootstrapValidator/zh_CN.js"></script>
<script src="../plugins/alert.js"></script>
<script src="../plugins/paging.js"></script>
<script src="../customize/js/common.js"></script>
<script src="../customize/js/CommonUtils.js"></script>
<script src="../customize/js/customModalV2.js"></script>
<script src="../customize/js/area.js"></script>
<script src="../customize/js/enterprise.js"></script>
<script>
    var enterpriseInfoView = false;
    var enterpriseInfoOpera = false;
    var label = ['order', 'name', 'position', 'logo', 'photo', 'contact', 'phone'];
    var title = ['#', '企业名称', '位置', 'logo', '照片', '联系人', '联系电话'];
</script>
<shiro:hasPermission name="enterprise:info:view">
    <script>
        enterpriseInfoView = true;
    </script>
</shiro:hasPermission>
<shiro:hasPermission name="enterprise:info:opera">
    <script>
        label.push('opera');
        title.push('操作');
        enterpriseInfoOpera = true;
    </script>
</shiro:hasPermission>
</html>